package com.bd08.flink.demo;

import com.profesorfalken.wmi4java.WMI4Java;
import com.profesorfalken.wmi4java.WMIClass;

import javax.print.PrintService;
import java.awt.print.PrinterJob;
import java.util.Arrays;
import java.util.List;

public class TestPrint {
    public static void main(String[] args) {

        PrintService[] services = PrinterJob.lookupPrintServices();
        for (int index = 0;  index < services.length; index++) {
            System.out.println(services[index].getName());
        }

        System.out.println(
                WMI4Java
                        .get()
                        .properties(Arrays.asList("Name", "WorkOffline"))
                        .getRawWMIObjectOutput(WMIClass.WIN32_PRINTER)
        );

        List<String> wmiClassesList = WMI4Java.get().namespace("root/WMI").listClasses();
        for(String wmic:wmiClassesList){
            System.out.println(wmic);
        }

    }
}
